<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <meta charset="utf-8">
    <title>设置流程节点</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" th:href="@{/js/layui/css/layui.css}"  media="all" />
    <link rel="stylesheet" th:href="@{/css/public.css}"  media="all" />
</head>
<body>
<div style="width:100%;-webkit-backface-visibility: hidden;">
    <div class="houselabel" >
        <form class="layui-form layui-row" style="padding: 5px 5px;" >
                <div class="layui-row layui-col-space10" style="text-align: center;position: absolute;top: 10px;left: 0px;bottom: 50px;overflow-y: auto;overflow-x: hidden;width: 100%">
                    <div class="layui-form-item magt3" >
                        <label class="layui-form-label">节点名称:</label>
                        <div class="layui-input-block">
                            <!--<input type="text" class="layui-input" name="packageName"  placeholder="请输入话术名称">-->
                            <input type="text" name="stepName" lay-verify="required" placeholder="请输入节点名称" autocomplete="off" class="layui-input"
                                   required th:value="${speakingFlowStep?.stepName}" >
                        </div>
                    </div>

                    <div class="layui-form-item magt3">
                        <label class="layui-form-label">提示话术:</label>
                        <div class="layui-input-block">
                            <textarea name="content" placeholder="请输入提示话术" class="layui-textarea" th:text="${speakingFlowStep?.content}"></textarea>
                        </div>
                    </div>

                    <div class="layui-form-item magt3" id="answerTypeDiv" >
                        <label class="layui-form-label">用户回答:</label>
                        <div class="layui-input-block">
                            <div style="margin: 5px;text-align: left">
                                <input type="checkbox" name="selectAll" id="selectAll" lay-filter="selectAll" lay-skin="primary" title="全部回答分支">
                            </div>
                            <blockquote class="layui-elem-quote title" style="text-align: left">默认回答分支</blockquote>
                            <div id="defaultCustomerAnswerTypeDiv" style="text-align: left" >
                                <th:block th:if="${defaultAnswerType}">
                                        <input  th:each="it:${defaultAnswerType}" lay-filter="oneChoose" type="checkbox" name="answerType" th:value="${it.id}" th:id="${it.id}" th:title="${it.name}" lay-skin="primary"
                                                th:checked="${selCheckBoxKeys !=null ? #lists.contains(selCheckBoxKeys,#strings.toString(it.id)):'false'}">
                                </th:block>
                            </div>
                            <blockquote class="layui-elem-quote title" style="text-align: left">自定义回答分支</blockquote>
                            <div id="customAnswerTypeDiv" style="text-align: left;max-height: 65px;height: 65px;overflow: auto;"  lay-filter="customAnswerTypeFilter" >
                                <th:block th:if="${customAnswerType}">
                                        <input  class=".customType" th:each="it:${customAnswerType}" lay-filter="oneChoose" type="checkbox" name="answerType"  th:id="${it.id}" th:value="${it.id}" th:title="${it.name}" lay-skin="primary"
                                                th:checked="${selCheckBoxKeys !=null ? #lists.contains(selCheckBoxKeys,#strings.toString(it.id)):'false'}">
                                </th:block>
                            </div>
                            <div style="margin: 5px;text-align: left">
                                <a class="layui-btn layui-btn-normal add_btn" id="add_answerType"><i class="layui-icon">&#xe654;</i>新建分支</a>
                            </div>
                        </div>
                    </div>


                    <div class="layui-form-item magt3">
                        <label class="layui-form-label">是否可打断:</label>
                        <div class="layui-input-block" style="text-align: left">
                            <input type="checkbox" name="actionCodeBreak" title="打断话术" th:checked="${speakingFlowStep?.actionCodeBreak==true?'checked':'false'}">
                            <!--<th:block th:if="${boolVal!=null}">
                                <select name="skipFlowStepId" lay-filter="flows" >
                                    <option value="">请选择</option>
                                    <option th:each="it:${boolVal}" th:selected="(${it.id} == ${speakingFlowStep?.actionCodeBreak})" th:value="${it.id}" th:text="${it.value}"></option>
                                </select>
                            </th:block>-->
                        </div>
                    </div>

                    <div class="layui-form-item magt3" style="display: none">
                        <label class="layui-form-label">其他设置:</label>
                        <div class="layui-input-block">
                            <div style="margin: 5px;text-align: left;width: 230px">
                                用户意向等级<th:block th:if="${userIntentionLevels!=null}">
                                    <select name="userIntentionLevel" lay-filter="userIntentionLevel" id="status" lay-search="" >
                                        <option value="">请选择用户意向等级(可输关键词)</option>
                                        <option th:each="it:${userIntentionLevels}" th:value="${it.value}" th:text="${it.desc}" ></option>
                                    </select>
                                </th:block>
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item"  style="display: none" >
                        <input type="text" id="id"  name="id" th:value="${stepId}" value="0" />
                    </div>

                    <div class="layui-form-item"  style="display: none" >
                        <input type="text" name="type" th:value="${type}"  value="0" />
                    </div>

                    <div class="layui-form-item"  style="display: none" >
                        <input type="text" name="flowId" th:value="${flowId}" value="0" />
                    </div>

                    <div class="layui-form-item"  style="display: none" >
                        <input type="text" name="packageId" th:value="${packageId}" value="0" />
                    </div>
                </div>
                <div style="position:absolute;left: 0px;bottom: 0px; width: 100%;height: 50px;background-color: #f2f2f2;padding: 0px;display: none" >
                    <button type="button" class="layui-btn" lay-submit lay-filter="add" style="width: 100px;float: right;margin-top: 7px;margin: 5px 5px;">保存</button>
                    <button type="button" class="layui-btn"  id="cancel"  style="width: 100px;margin-top: 7px;background-color: #b2b2b2;float: right;margin: 5px 5px;" >取消</button>
                    <button type="button" class="layui-btn"  id="reloadForm"  style="display: none" >刷新form</button>
                    <input type="button" style="display: none" id="dataVal" value="">
                </div>
        </form>
    </div>

    <div class="todoMenu customMenu" style="display: none">
        <div class="editCustomType" >编辑</div>
        <div class="deleteCustomType">删除</div>
    </div>
</div>
<script th:inline="javascript">
    const baseUrl = [[${#servletContext.contextPath}]];
    var flowId = [[${flowId}]];
    var stepId = [[${stepId}]];
    console.log(window.parent);
    console.log(window.parent.name);
</script>
<script type="text/javascript"   th:src="@{/js/jquery-1.7.2.min.js}"></script>
<script type="text/javascript"   th:src="@{/js/layui/layui.js}"></script>
<script type="text/javascript" th:src="@{/js/layui/layui.all.js}"></script>
<script type="text/javascript"   th:src="@{/js/page/flow/config/saveOrUpdateSpeakingFlowStep.js}"></script>
<script type="text/javascript"   th:src="@{/js/page/utils.js}"></script>
</body>
</html>